<template>
<div>
  <van-notice-bar left-icon="volume-o" :scrollable="false">
    <van-swipe
        vertical
        class="notice-swipe"
        :autoplay="3000"
        :show-indicators="false"
    >
      <van-swipe-item v-for="(item,index) in list" :key="index">
        {{item.name}} <span>今日新增:{{item.today.confirm}}人</span>
      </van-swipe-item>

    </van-swipe>
  </van-notice-bar>

</div>
</template>

<script>
import {covid} from "@/api/http";

export default {
  data(){
    return {
      list:[],
      // listOne:[],
      show: false
    }
  },
name: "covid",
  created() {
  covid().then(res=>{
    console.log(res)
    console.log(JSON.parse(res.data))
    console.log(JSON.parse(res.data).areaTree[0].children)
    this.list = JSON.parse(res.data).areaTree[0].children
    // this.listOne = JSON.parse(res.data).areaTree[0].children.children
  })
  }
}
</script>

<style scoped lang="less">
.notice-swipe {
  height: 40px;
  line-height: 40px;
}
</style>